// pages/zhuce/zhuce.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    focus:false,
    inputValue1:"",
    inputValue2:"",
    inputValue3:"",
    inputValue4:"",
    inputValue5:"",
    inputValue6:"",
    color1:"yellow"
  },
  bindInputFocus:function(){
    
    this.setData({
      focus: true
    })
  },
  bindKeyInput:function(e){
    // console.log(e.detail.value.length);
    switch (e.detail.value.length) {
      case 0:
        this.setData({
          color1: "yellow",
          inputValue1: ""
        })
        break;
      case 1:
        this.setData({
          inputValue2:"",
          color2: "saddlebrown",
          inputValue1: e.detail.value[0]
        })
        break;
      case 2:
        
        this.setData({
          inputValue3: "",
          color1:"saddlebrown",
          color2: "yellow",
          color3: "saddlebrown",
          inputValue2: e.detail.value[1]
        })
        break;
      case 3:
        this.setData({
          inputValue4: "",
          color2: "saddlebrown",
          color3: "yellow",
          color4: "saddlebrown",
          inputValue3: e.detail.value[2]
        })
        break;
      case 4:
        this.setData({
          inputValue5: "",
          color3: "saddlebrown",
          color4: "yellow",
          color5: "saddlebrown",
          inputValue4: e.detail.value[3]
        })
        break;
      case 5:
        this.setData({
          inputValue6:"",
          color4: "saddlebrown",
          color5: "yellow",
          color6: "saddlebrown",
          inputValue5: e.detail.value[4]
        })
        break;
      case 6:
        this.setData({
          color5: "saddlebrown",
          color6: "yellow",
          inputValue6: e.detail.value[5]
        })
        break;
    }
    
    

  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
   
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})